Problem Set 2 - PPOL 563

The first question again requires you to work with the Global Power Plant Database contained in this repository. You can also find associated documentation for the dataset, including a data dictionary, a README file and release notes. The data and all associated materials can also be found here.

Question 1: Reproduce the map plot below, which shows the capacity_mw and location of power generation facilities in Washington DC, Maryland, Virginia and West Virginia. Things to note:


Question 2: Reproduce the map plot below, which shows median household income from the 2016-2020 ACS in Virginia by county. BUT, the counties that comprise Northern Virginia are grouped together into one distinct region, while the rest of the state is represented by individual counties. The variable shown for those Northern Virginia counties is the median of the median household incomes for that group of counties. I used the definition of Northern Virginia from here. A few things to take note of:


Question 3: Reproduce the hexbin map below, which displays results from the 2016 presidential election by state, including the percent margin and the winner of each state. Things to take note of:


Question 4: Use the tidyquant library and it’s tq_get function to grab the historical stock prices for the FAANG stocks: Facebook, Apple, Amazon, Netflix, and Google. Then recreate the animated plot below. Things to take note of:

For the final two questions of the problem set, you will be required to make your own visualizations without any reference viz to guide you.


Question 5: Using gun_background_checks.csv, create a choropleth map of any element from the dataset. The data is a file of Firearm Background Check data collected by the FBI. You can find details on the data here

Your plot should have a legend (if necessary), descriptive title and subtitle, and all plot elements should be human readable (no overlapping text, no acronyms unless they are defined, no underscores). Scales should make sense and be rounded to 2 digits or less (if applicable). You may NOT use the default Mercator projection

BONUS: (not required) - turn this into an interactive map (with appropriate popups) using the leaflet package.


Question 6: Create an animated plot using the FAANG stock data in which you reveal the adjusted prices of the stocks by date as a line chart. Make sure the animation is not too fast AND not too slow. To do so, you’ll likely have to manipulate the number of frames generated and/or the FPS (hint: look at the animation() documentation).

Your plot should have a legend (if necessary), descriptive title and subtitle, and all plot elements should be human readable (no overlapping text, no acronyms unless they are defined, no underscores). Scales should make sense and be rounded to 2 digits or less (if applicable).

BONUS: (not required) - Pause the animation at the end of the time series for a reasonable amount of time before it loops again.